package com.zjitc;

import java.sql.Connection;
import java.sql.SQLException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import javax.sql.DataSource;
/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
      ApplicationContext context=new AnnotationConfigApplicationContext(DS.class);
      DataSource dataSource = context.getBean(DataSource.class);
    try{
      Connection connection=dataSource.getConnection();
      System.out.println(connection);
    }

    catch (SQLException e)
    {
      e.printStackTrace();
    }
    }
}
